home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / xpcom / nsIEventQueueService.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  11KB  |  267 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIEventQueueService.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIEventQueueService_h__
  6. #define __gen_nsIEventQueueService_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. #ifndef __gen_nsIEventQueue_h__
  14. #include "nsIEventQueue.h"
  15. #endif
  16.  
  17. /* For IDL files that don't want to include root IDL files. */
  18. #ifndef NS_NO_VTABLE
  19. #define NS_NO_VTABLE
  20. #endif
  21. #include "prthread.h"
  22. #include "plevent.h"
  23. /* be761f00-a3b0-11d2-996c-0080c7cb1080 */
  24. #define NS_EVENTQUEUESERVICE_CID \
  25. { 0xbe761f00, 0xa3b0, 0x11d2, \
  26.   {0x99, 0x6c, 0x00, 0x80, 0xc7, 0xcb, 0x10, 0x80} }
  27. #define NS_EVENTQUEUESERVICE_CONTRACTID "@mozilla.org/event-queue-service;1"
  28. #define NS_EVENTQUEUESERVICE_CLASSNAME "Event Queue Service"
  29. #define NS_CURRENT_THREAD    ((PRThread*)0)
  30. #define NS_CURRENT_EVENTQ    ((nsIEventQueue*)0)
  31. #define NS_UI_THREAD         ((PRThread*)1)
  32. #define NS_UI_THREAD_EVENTQ  ((nsIEventQueue*)1)
  33. class nsIThread; /* forward declaration */
  34.  
  35.  
  36. /* starting interface:    nsIEventQueueService */
  37. #define NS_IEVENTQUEUESERVICE_IID_STR "a6cf90dc-15b3-11d2-932e-00805f8add32"
  38.  
  39. #define NS_IEVENTQUEUESERVICE_IID \
  40.   {0xa6cf90dc, 0x15b3, 0x11d2, \
  41.     { 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 }}
  42.  
  43. class NS_NO_VTABLE nsIEventQueueService : public nsISupports {
  44.  public: 
  45.  
  46.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IEVENTQUEUESERVICE_IID)
  47.  
  48.   /**
  49.    * Creates and holds a native event queue for the current thread.
  50.    * "Native" queues have an associated callback mechanism which is
  51.    * automatically triggered when an event is posted. See plevent.c for 
  52.    * details.
  53.    * @return NS_OK on success, or a host of failure indications
  54.    */
  55.   /* void createThreadEventQueue (); */
  56.   NS_IMETHOD CreateThreadEventQueue(void) = 0;
  57.  
  58.   /**
  59.    * Creates and hold a monitored event queue for the current thread.
  60.    * "Monitored" queues have no callback processing mechanism.
  61.    * @return NS_OK on success, or a host of failure indications
  62.    */
  63.   /* void createMonitoredThreadEventQueue (); */
  64.   NS_IMETHOD CreateMonitoredThreadEventQueue(void) = 0;
  65.  
  66.   /**
  67.    * Somewhat misnamed, this method releases the service's hold on the event
  68.    * queue(s) for this thread. Subsequent attempts to access this thread's
  69.    * queue (GetThreadEventQueue, for example) may fail, though the queue itself
  70.    * will be destroyed only after all references to it are released and the
  71.    * queue itself is no longer actively processing events.
  72.    * @return nonsense.
  73.    */
  74.   /* void destroyThreadEventQueue (); */
  75.   NS_IMETHOD DestroyThreadEventQueue(void) = 0;
  76.  
  77.   /* nsIEventQueue createFromIThread (in nsIThread aThread, in boolean aNative); */
  78.   NS_IMETHOD CreateFromIThread(nsIThread *aThread, PRBool aNative, nsIEventQueue **_retval) = 0;
  79.  
  80.   /* [noscript] nsIEventQueue createFromPLEventQueue (in PLEventQueuePtr aPLEventQueue); */
  81.   NS_IMETHOD CreateFromPLEventQueue(PLEventQueue * aPLEventQueue, nsIEventQueue **_retval) = 0;
  82.  
  83.   /* nsIEventQueue pushThreadEventQueue (); */
  84.   NS_IMETHOD PushThreadEventQueue(nsIEventQueue **_retval) = 0;
  85.  
  86.   /* void popThreadEventQueue (in nsIEventQueue aQueue); */
  87.   NS_IMETHOD PopThreadEventQueue(nsIEventQueue *aQueue) = 0;
  88.  
  89.   /* [noscript] nsIEventQueue getThreadEventQueue (in PRThreadPtr aThread); */
  90.   NS_IMETHOD GetThreadEventQueue(PRThread * aThread, nsIEventQueue **_retval) = 0;
  91.  
  92.   /**
  93.    * @deprecated in favor of getSpecialEventQueue, since that's
  94.    * scriptable and this isn't.
  95.    *
  96.    * Check for any "magic" event queue constants (NS_CURRENT_EVENTQ,
  97.    * NS_UI_THREAD_EVENTQ) and return the real event queue that they
  98.    * represent, AddRef()ed.  Otherwise, return the event queue passed
  99.    * in, AddRef()ed.  This is not scriptable because the arguments in
  100.    * question may be magic constants rather than real nsIEventQueues.
  101.    *
  102.    * @arg queueOrConstant    either a real event queue or a magic
  103.    *                         constant to be resolved
  104.    *
  105.    * @return                 a real event queue, AddRef()ed
  106.    */
  107.   /* [noscript] nsIEventQueue resolveEventQueue (in nsIEventQueue queueOrConstant); */
  108.   NS_IMETHOD ResolveEventQueue(nsIEventQueue *queueOrConstant, nsIEventQueue **_retval) = 0;
  109.  
  110.   /**
  111.    * Returns the appropriate special event queue, AddRef()ed.  Really
  112.    * just a scriptable version of ResolveEventQueue.
  113.    *
  114.    * @arg aQueue    Either CURRENT_THREAD_EVENT_QUEUE or
  115.    *                UI_THREAD_EVENT_QUEUE
  116.    * @return        The requested nsIEventQueue, AddRef()ed
  117.    * @exception NS_ERROR_NULL_POINTER   Zero pointer passed in for return value
  118.    * @exception NS_ERROR_ILLEGAL_VALUE  Bogus constant passed in aQueue
  119.    * @exception NS_ERROR_FAILURE        Error while calling 
  120.    *                                    GetThreadEventQueue()
  121.    */
  122.   /* nsIEventQueue getSpecialEventQueue (in long aQueue); */
  123.   NS_IMETHOD GetSpecialEventQueue(PRInt32 aQueue, nsIEventQueue **_retval) = 0;
  124.  
  125.   enum { CURRENT_THREAD_EVENT_QUEUE = 0 };
  126.  
  127.   enum { UI_THREAD_EVENT_QUEUE = 1 };
  128.  
  129. };
  130.  
  131. /* Use this macro when declaring classes that implement this interface. */
  132. #define NS_DECL_NSIEVENTQUEUESERVICE \
  133.   NS_IMETHOD CreateThreadEventQueue(void); \
  134.   NS_IMETHOD CreateMonitoredThreadEventQueue(void); \
  135.   NS_IMETHOD DestroyThreadEventQueue(void); \
  136.   NS_IMETHOD CreateFromIThread(nsIThread *aThread, PRBool aNative, nsIEventQueue **_retval); \
  137.   NS_IMETHOD CreateFromPLEventQueue(PLEventQueue * aPLEventQueue, nsIEventQueue **_retval); \
  138.   NS_IMETHOD PushThreadEventQueue(nsIEventQueue **_retval); \
  139.   NS_IMETHOD PopThreadEventQueue(nsIEventQueue *aQueue); \
  140.   NS_IMETHOD GetThreadEventQueue(PRThread * aThread, nsIEventQueue **_retval); \
  141.   NS_IMETHOD ResolveEventQueue(nsIEventQueue *queueOrConstant, nsIEventQueue **_retval); \
  142.   NS_IMETHOD GetSpecialEventQueue(PRInt32 aQueue, nsIEventQueue **_retval); \
  143.  
  144. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  145. #define NS_FORWARD_NSIEVENTQUEUESERVICE(_to) \
  146.   NS_IMETHOD CreateThreadEventQueue(void) { return _to CreateThreadEventQueue(); } \
  147.   NS_IMETHOD CreateMonitoredThreadEventQueue(void) { return _to CreateMonitoredThreadEventQueue(); } \
  148.   NS_IMETHOD DestroyThreadEventQueue(void) { return _to DestroyThreadEventQueue(); } \
  149.   NS_IMETHOD CreateFromIThread(nsIThread *aThread, PRBool aNative, nsIEventQueue **_retval) { return _to CreateFromIThread(aThread, aNative, _retval); } \
  150.   NS_IMETHOD CreateFromPLEventQueue(PLEventQueue * aPLEventQueue, nsIEventQueue **_retval) { return _to CreateFromPLEventQueue(aPLEventQueue, _retval); } \
  151.   NS_IMETHOD PushThreadEventQueue(nsIEventQueue **_retval) { return _to PushThreadEventQueue(_retval); } \
  152.   NS_IMETHOD PopThreadEventQueue(nsIEventQueue *aQueue) { return _to PopThreadEventQueue(aQueue); } \
  153.   NS_IMETHOD GetThreadEventQueue(PRThread * aThread, nsIEventQueue **_retval) { return _to GetThreadEventQueue(aThread, _retval); } \
  154.   NS_IMETHOD ResolveEventQueue(nsIEventQueue *queueOrConstant, nsIEventQueue **_retval) { return _to ResolveEventQueue(queueOrConstant, _retval); } \
  155.   NS_IMETHOD GetSpecialEventQueue(PRInt32 aQueue, nsIEventQueue **_retval) { return _to GetSpecialEventQueue(aQueue, _retval); } \
  156.  
  157. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  158. #define NS_FORWARD_SAFE_NSIEVENTQUEUESERVICE(_to) \
  159.   NS_IMETHOD CreateThreadEventQueue(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateThreadEventQueue(); } \
  160.   NS_IMETHOD CreateMonitoredThreadEventQueue(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateMonitoredThreadEventQueue(); } \
  161.   NS_IMETHOD DestroyThreadEventQueue(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->DestroyThreadEventQueue(); } \
  162.   NS_IMETHOD CreateFromIThread(nsIThread *aThread, PRBool aNative, nsIEventQueue **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateFromIThread(aThread, aNative, _retval); } \
  163.   NS_IMETHOD CreateFromPLEventQueue(PLEventQueue * aPLEventQueue, nsIEventQueue **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateFromPLEventQueue(aPLEventQueue, _retval); } \
  164.   NS_IMETHOD PushThreadEventQueue(nsIEventQueue **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->PushThreadEventQueue(_retval); } \
  165.   NS_IMETHOD PopThreadEventQueue(nsIEventQueue *aQueue) { return !_to ? NS_ERROR_NULL_POINTER : _to->PopThreadEventQueue(aQueue); } \
  166.   NS_IMETHOD GetThreadEventQueue(PRThread * aThread, nsIEventQueue **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetThreadEventQueue(aThread, _retval); } \
  167.   NS_IMETHOD ResolveEventQueue(nsIEventQueue *queueOrConstant, nsIEventQueue **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ResolveEventQueue(queueOrConstant, _retval); } \
  168.   NS_IMETHOD GetSpecialEventQueue(PRInt32 aQueue, nsIEventQueue **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSpecialEventQueue(aQueue, _retval); } \
  169.  
  170. #if 0
  171. /* Use the code below as a template for the implementation class for this interface. */
  172.  
  173. /* Header file */
  174. class nsEventQueueService : public nsIEventQueueService
  175. {
  176. public:
  177.   NS_DECL_ISUPPORTS
  178.   NS_DECL_NSIEVENTQUEUESERVICE
  179.  
  180.   nsEventQueueService();
  181.  
  182. private:
  183.   ~nsEventQueueService();
  184.  
  185. protected:
  186.   /* additional members */
  187. };
  188.  
  189. /* Implementation file */
  190. NS_IMPL_ISUPPORTS1(nsEventQueueService, nsIEventQueueService)
  191.  
  192. nsEventQueueService::nsEventQueueService()
  193. {
  194.   /* member initializers and constructor code */
  195. }
  196.  
  197. nsEventQueueService::~nsEventQueueService()
  198. {
  199.   /* destructor code */
  200. }
  201.  
  202. /* void createThreadEventQueue (); */
  203. NS_IMETHODIMP nsEventQueueService::CreateThreadEventQueue()
  204. {
  205.     return NS_ERROR_NOT_IMPLEMENTED;
  206. }
  207.  
  208. /* void createMonitoredThreadEventQueue (); */
  209. NS_IMETHODIMP nsEventQueueService::CreateMonitoredThreadEventQueue()
  210. {
  211.     return NS_ERROR_NOT_IMPLEMENTED;
  212. }
  213.  
  214. /* void destroyThreadEventQueue (); */
  215. NS_IMETHODIMP nsEventQueueService::DestroyThreadEventQueue()
  216. {
  217.     return NS_ERROR_NOT_IMPLEMENTED;
  218. }
  219.  
  220. /* nsIEventQueue createFromIThread (in nsIThread aThread, in boolean aNative); */
  221. NS_IMETHODIMP nsEventQueueService::CreateFromIThread(nsIThread *aThread, PRBool aNative, nsIEventQueue **_retval)
  222. {
  223.     return NS_ERROR_NOT_IMPLEMENTED;
  224. }
  225.  
  226. /* [noscript] nsIEventQueue createFromPLEventQueue (in PLEventQueuePtr aPLEventQueue); */
  227. NS_IMETHODIMP nsEventQueueService::CreateFromPLEventQueue(PLEventQueue * aPLEventQueue, nsIEventQueue **_retval)
  228. {
  229.     return NS_ERROR_NOT_IMPLEMENTED;
  230. }
  231.  
  232. /* nsIEventQueue pushThreadEventQueue (); */
  233. NS_IMETHODIMP nsEventQueueService::PushThreadEventQueue(nsIEventQueue **_retval)
  234. {
  235.     return NS_ERROR_NOT_IMPLEMENTED;
  236. }
  237.  
  238. /* void popThreadEventQueue (in nsIEventQueue aQueue); */
  239. NS_IMETHODIMP nsEventQueueService::PopThreadEventQueue(nsIEventQueue *aQueue)
  240. {
  241.     return NS_ERROR_NOT_IMPLEMENTED;
  242. }
  243.  
  244. /* [noscript] nsIEventQueue getThreadEventQueue (in PRThreadPtr aThread); */
  245. NS_IMETHODIMP nsEventQueueService::GetThreadEventQueue(PRThread * aThread, nsIEventQueue **_retval)
  246. {
  247.     return NS_ERROR_NOT_IMPLEMENTED;
  248. }
  249.  
  250. /* [noscript] nsIEventQueue resolveEventQueue (in nsIEventQueue queueOrConstant); */
  251. NS_IMETHODIMP nsEventQueueService::ResolveEventQueue(nsIEventQueue *queueOrConstant, nsIEventQueue **_retval)
  252. {
  253.     return NS_ERROR_NOT_IMPLEMENTED;
  254. }
  255.  
  256. /* nsIEventQueue getSpecialEventQueue (in long aQueue); */
  257. NS_IMETHODIMP nsEventQueueService::GetSpecialEventQueue(PRInt32 aQueue, nsIEventQueue **_retval)
  258. {
  259.     return NS_ERROR_NOT_IMPLEMENTED;
  260. }
  261.  
  262. /* End of implementation class template. */
  263. #endif
  264.  
  265.  
  266. #endif /* __gen_nsIEventQueueService_h__ */
  267.